package redis

// 哈希表命令

func HSet(key, field, value string) (int, error) {
	return insRedis.Int("HSET", key, field, value)
}

func HSetNx(key, field, value string) (int, error) {
	return insRedis.Int("HSETNX", key, field, value)
}

func HGet(key, field string) (string, error) {
	return insRedis.String("HGET", key, field)
}

func HGetAll(key string) (map[string]string, error) {
	return insRedis.StringMap("HGETALL", key)
}

func HExists(key string) (map[string]string, error) {
	return insRedis.StringMap("HEXISTS", key)
}

func HDel(key string, fields ...interface{}) (int, error) {
	return insRedis.Int("HDEL", key, fields)
}

func HKeys(key string) ([]string, error) {
	return insRedis.Strings("HKEYS", key)
}

func HVals(key string) ([]string, error) {
	return insRedis.Strings("HVALS", key)
}

func HLen(key string) (int, error) {
	return insRedis.Int("HLEN", key)
}

func HIncrBy(key, field string, increment int) (int64, error) {
	return insRedis.Int64("HINCRBY", key, field, increment)
}
